import { Component, OnInit, ViewChild } from "@angular/core";
import { Router } from '@angular/router';
import { MessageService } from 'src/app/core/service/message.service';
import { NzCarouselModule } from 'ng-zorro-antd/carousel';

@Component({
    templateUrl: "./index.html",
    styleUrls: ["./index.scss"]
})
export class IndexComponent implements OnInit {
	array = [
		'../../../../assets/img/home-page/banner1.png', 
		'../../../../assets/img/home-page/banner2.png', 
		'../../../../assets/img/home-page/banner3.png'
	];
	idcardBackImage;
	statusDatas=[{
		v: 1,
		name: '委托检测'
	}, {
		v: 2,
		name: '型式检测'
	}, {
		v: 3,
		name: '远程检测'
	}]
	page = {
		status:1
	};
	
    constructor(
        private router: Router,
        private message:MessageService
    ) {}

    ngOnInit() {
		// this.message.sendMessage('setHeader','indexPage');
		this.message.setBreadcrumb({
            breadcrumbs: [
                { name: '首页' }
            ]
        });
    }
    bannerTo(item) {
		//routerLink="/agency" [queryParams]='{id:i.productId}'
		if (item.url) {
			window.open(item.url);
		} else {
			if (item.openType == 'Recruit') {
				// 去活动页
				this.router.navigate(['/activity'], {
					queryParams: { id: item.productId }
				});
			} else {
				this.router.navigate(['/agency'], {
					queryParams: { id: item.productId }
				});
			}
		}
	}
	onChangeSearch(){
	}
	showMsgWindow(){
		this.message.sendMessage('showMsgWindow','member');
	}
}
